#左下三角形
for i in range(1,10): # 设置循环次数9次
    row = ""
    for j in range(1,i+1):
        row += "{0}*{1}={2} ".format(j,i,i*j)
    print(row)
print("-"*63)
#左上三角形
for i in range(9,0,-1): # 设置循环次数9次
    row = ""
    for j in range(1,i+1):
        row += "{0}*{1}={2} ".format(j,i,i*j)
    print(row)
print("*"*10)
#
##右下下三角形
for i in range(1,10): # 设置循环次数9次
    row = "-------"*(9-i)
    for j in range(i,0,-1):
        row += "{:<1}*{:<1}={:<2} ".format(j, i, i * j)
    print(row)
print("-"*63)
#右上三角形
for i in range(9,0,-1): # 设置循环次数9次
    row = "-------"*(9-i)
    for j in range(i,0,-1):
        row += "{:<1}*{:<1}={:<2} ".format(j, i, i * j)
    print(row)

#左下三角形
i=1
while i<10:
    row = ""
    j = 1
    while j < i+1:
        row += "{0}*{1}={2} ".format(j,i,i*j)
        j += 1
    print(row)
    i += 1
print("--->"*12)

# 左上三角形
i = 9
while i >0:
    row = ""
    j = 1
    while j <= i:
        row += "{0}*{1}={2} ".format(j, i, i * j)
        j += 1
    print(row)
    i -= 1


##右下三角形
i = 1
while i<10:
    row = "-------"*(9-i)
    j = 1
    while j <= i:
        row += "{:<1}*{:<1}={:<2} ".format(j, i, i * j)
        j += 1
    print(row)
    i += 1
print("-"*63)
#右上三角形
i = 9
while i >0:
    row = "-------" * (9 - i)
    j = 1
    while j<=i :
        row += "{:<1}*{:<1}={:<2} ".format(j, i, i * j)
        j += 1
    print(row)
    i -= 1

# for i in range(9,0,-1): # 设置循环次数9次
#     row = "-------"*(9-i)
#     for j in range(i,0,-1):
#         row += "{:<1}*{:<1}={:<2} ".format(j, i, i * j)
#     print(row)




# for i in range(9,0,-1): # 设置循环次数9次
#     row = ""
#     for j in range(1,i+1):
#         row += "{0}*{1}={2} ".format(j,i,i*j)
#     print(row)
# print("*"*10)







